import plotly.graph_objects as go
import numpy as np

x = np.arange(-2 * np.pi, 2 * np.pi, 0.1)
y_tan = np.tan(x)

fig = go.Figure()
fig.add_trace(go.Scatter(x=x, y=y_tan, mode="lines", name="tan"))
fig.update_layout(
    title="tan(x)函数",
    xaxis_title="x",
    yaxis_title="y",
    yaxis=dict(
        range=[-5, 5],
    ),
)
fig.show()
